import os
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'


# 将python程序发布成exe
def publish():
    order_list = []
    prefix = "pyinstaller "
    filename = PROJECT_PATH + "password_manager.py "
    order_list.append(' '.join(['--workpath', PROJECT_PATH + "temp"]))
    order_list.append(' '.join(['--distpath', PROJECT_PATH + 'dist']))
    # 钩子文件
    order_list.append('='.join(['--runtime-hook', PROJECT_PATH + 'runtimehook1.py']))
    # exe文件图标
    order_list.append(' '.join(['-i', PROJECT_PATH + 'favicon.ico']))
    order = prefix + filename + ' '.join(order_list)
    return order

def main():
    os.system(publish())


if __name__ == "__main__":
    main()


